#===============================================================================
# Koro Business Environment
# Copyright (C) 2010  Antonio Corroppoli
#
#This file is part of Koro BE.
# 
# Koro BE is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# 
# Koro BE is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with Koro BE; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
#===============================================================================

import datetime

class DateType(object):
    def __init__(self):
        self.__day=datetime.date.today().day
        self.__month=datetime.date.today().month
        self.__year=datetime.date.today().year
        self.__format="%02d/%02d/%d"

    def getDay(self):
        return self.__day

    def getMonth(self):
        return self.__month

    def getYear(self):
        return self.__year

    def __getDateString(self):
        text = self.__format % (self.__day,self.__month,self.__year)
        return text

    def setFormat(self, value):
        self.__format = value
        
    def set(self,day,month,year):
        self.__day=day
        self.__month=month
        self.__year=year

    format = property(None, setFormat, None, "Format's Docstring")

    toString = property(__getDateString, None, None, "Data's Docstring")

    day = property(getDay, None, None, "Day's Docstring")

    month = property(getMonth, None, None, "Month's Docstring")

    year = property(getYear, None, None, "Year's Docstring")
    